package com.example.leetdemo.process;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Solution3477 {


    public int numOfUnplacedFruits(int[] fruits, int[] baskets) {
//        Arrays.parallelSort(baskets);
        int[] basket_arr = new int[baskets.length];
        int size = 0;
        for (int j = 0; j < fruits.length; j++) {
            for (int i = 0; i < baskets.length; i++) {
                if (fruits[j] <= baskets[i] && basket_arr[i] != 0) {
                    size++;
                    basket_arr[i]++;
                    break;
                }
            }
        }
        return fruits.length - size;
    }

    public static void main(String[] args) {
        HashMap<Integer, Integer> map = new HashMap<>();
        if (map instanceof Map) {
            System.err.println(true);
        }
    }

}
